<template>
    <div>
        <!-- 面包屑导航区域 -->
        <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item>权限管理</el-breadcrumb-item>
        <el-breadcrumb-item>权限列表</el-breadcrumb-item>
        </el-breadcrumb>

        <!-- 卡片展示区域 -->
        <el-card class="box-card">
            <!-- 添加角色按钮部分 -->
            <el-row>
                <el-col>
                 <el-button type="primary">添加角色</el-button>
                </el-col>
            </el-row>

            <!-- 角色列表展示部分 -->
            <el-table :data="roleList" border stripe>
                <el-table-column type="expand"></el-table-column>
                <!-- 索引列 -->
                <el-table-column type="index"></el-table-column>
                <el-table-column label="角色名称" prop="roleName"></el-table-column>
                <el-table-column label="角色描述" prop="roleDesc"></el-table-column>
                <el-table-column label="操作" width="300px">
                    <template slot-scope="scope" >
                        <el-button size="mini" type="primary" icon="el-icon-edit">编辑</el-button>
                        <el-button size="mini" type="success" icon="el-icon-delete">删除</el-button>
                        <el-button size="mini" type="warning" icon="el-icon-s-tools">分配权限</el-button>
                    </template>
                </el-table-column>
            </el-table>

       


        </el-card>
    </div>
</template>

<script>
export default {
    name: 'roles',
    data(){
        return{
            roleList: [],
           
        }
    },
    created() {
        this.getRolesList()
    },
    methods: {
        // 刷新列表数据
       async getRolesList() {
            const { data: res } = await this.$http.get('roles')
            if (res.meta.status !== 200) {
            return this.$message.error('获取角色列表失败')
            }
            this.roleList = res.data
        },
        
    }
}

</script>

<style lang="less" scoped>

</style>